package com.huoniu.facade.entity.user;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.mapper.SqlCondition;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.sql.Timestamp;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder(toBuilder = true)
@TableName(value = "user")
public class UserEntity implements Serializable {
    @TableId(type=IdType.AUTO)
    private Integer id;
    @TableField(condition = SqlCondition.LIKE)
    private String name;
    private Integer age;
    @TableField(condition = SqlCondition.LIKE)
    private String email;
    private Timestamp createtime;
    private Timestamp updatetime;

    public UserEntity(String name, String email, int age) {
        this.name=name;
        this.email=email;
        this.age = age;
    }


    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }

}
